import 'package:flutter/material.dart';

import 'searchAppBar.dart';


// Widget for the route pushed by the `RestorableRouteFuture`.
class MyCounter extends StatefulWidget {
  const MyCounter({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyCounter> createState() => _MyCounterState();
}

class _MyCounterState extends State<MyCounter> with RestorationMixin {
  final RestorableInt _count = RestorableInt(0);

  @override
  String get restorationId => 'counter';

  @override
  void restoreState(RestorationBucket? oldBucket, bool initialRestore) {
    registerForRestoration(_count, 'count');
  }

  @override
  void dispose() {
    super.dispose();
    _count.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: new SAppBarSearch(
        hintText: '搜索',
        onCancel: () {
          print("这是取消");
          print(context);
        Navigator.of(context).pop();
        },
        onTap: () { print("这是点击"); },
        focusNode: FocusNode(),
        autoFocus:true,
        // suffix: new Icon(Icons.eleven_mp),
        value: '',
        // controller: new TextEditingController(text: "1123123"),
        // leading: ,
        onClear: () {
          print("这是清除");
        },
        onChanged: (value) {
          print("这是改变::"+value);
        },
        onSearch: (value) {
          print("这是搜索的内容:::"+value);
        },
      ),
      body: new Padding(
        padding: const EdgeInsets.all(16.0),
        // child: new ChoiceCard(choice: _selectedChoice, key: , ),
      ),
      // body: Center(
      //   child: Text('Count: ${_count.value}'),
      // ),
      // floatingActionButton: FloatingActionButton(
      //   child: const Icon(Icons.add),
      //   onPressed: () {
      //     setState(() {
      //       _count.value++;
      //     });
      //   },
      // ),
    );
  }
}
